{include file='_header'}

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item['id'])}编辑{else}添加{/if}首页导航{if !empty($item['id'])}({$item['navname']}){/if}</span>
</div>

<div class="page-content">
    <div class="page-sub-toolbar">
        <span class=''>
            <a class="btn btn-primary btn-sm" href="{:url('admin/shop/navadd')}">添加新首页导航</a>
        </span>
    </div>
    <form {ife 'shop.nav' $item}action="" method="post"{/if} class="form-horizontal form-validate" enctype="multipart/form-data">
        <input type="hidden" name="id" value="{$item['id']}" />
            <div class="form-group">
                <label class="col-lg control-label">排序</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}" />
                    <span class='help-block'>数字越大，排名越靠前</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg control-label must">首页导航标题</label>
                <div class="col-sm-9 col-xs-12 ">
                    <input type="text" id='navname' name="navname" class="form-control" value="{$item['navname']}" data-rule-required="true"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg control-label">首页导航图片</label>
                <div class="col-sm-9 col-xs-12">
                    {:tpl_form_field_image2('icon', $item['icon'])}
                    <span class='help-block'>建议尺寸:100 * 100 , 请将所有首页导航图片尺寸保持一致</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg control-label">首页导航链接</label>
                <div class="col-sm-9 col-xs-12">
                    <div class="input-group form-group" style="margin: 0;">
                        <input type="text" value="{$item['url']}" class="form-control valid" name="url" placeholder="" id="navlink">
                        <span class="input-group-btn">
                            <span data-input="#navlink" data-toggle="selectUrl" class="btn btn-default">选择链接</span>
                        </span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg control-label">状态</label>
                <div class="col-sm-9 col-xs-12">
                    <label class='radio-inline'><input type='radio' name='status' value=1' {if $item['status']==1}checked{/if} /> 显示</label>
                    <label class='radio-inline'><input type='radio' name='status' value=0' {if $item['status']==0}checked{/if} /> 隐藏</label>
                </div>
            </div>

            <div class="form-group">
                <label class="col-lg control-label"></label>
                <div class="col-sm-9 col-xs-12">
                        <input type="submit" value="提交" class="btn btn-primary"/>
                    <input type="button" name="back" onclick='history.back()' style='margin-left:10px;' value="返回列表" class="btn btn-default"/>
                </div>
            </div>
    </form>
</div>

<script language='javascript'>
    function formcheck() {
        if ($("#navname").isEmpty()) {
            Tip.focus("navname", "请填写首页导航名称!");
            return false;
        }
        return true;
    }
</script>

{include file='_footer'}